import request from '@/utils/request'

/**
 * 招聘启动岗位列表
 */
export function hrmRecruitStartPositionQueryListAPI(data) {
  return request({
    url: 'hrmRecruitStartPosition/queryRecruitStartPositionPageList',
    method: 'post',
    data: data,
    headers: {
      'Content-Type': 'application/json;charset=UTF-8'
    }
  })
}

/**
 * 招聘启动岗位详情
 */
export function hrmRecruitStartPositionQueryByIdAPI(startPositionId) {
  return request({
    url: 'hrmRecruitStartPosition/queryById/' + startPositionId,
    method: 'post',
  })
}

/**
 * 招聘启动岗位新增
 */
export function hrmRecruitStartPositionAddAPI(data) {
  return request({
    url: 'hrmRecruitStartPosition/addRecruitStartPosition',
    method: 'post',
    data: data,
    headers: {
      'Content-Type': 'application/json;charset=UTF-8'
    }
  })
}

/**
 * 招聘启动岗位修改
 */
export function hrmRecruitStartPositionSetAPI(data) {
  return request({
    url: 'hrmRecruitStartPosition/setRecruitStartPosition',
    method: 'post',
    data: data,
    headers: {
      'Content-Type': 'application/json;charset=UTF-8'
    }
  })
}

/**
 * 招聘启动岗位删除
 */
export function hrmRecruitStartPositionDeleteAPI(data) {
  return request({
    url: 'hrmRecruitStartPosition/batchDeleteRecruitStartPosition',
    method: 'post',
    data: data,
    headers: {
      'Content-Type': 'application/json;charset=UTF-8'
    }
  })
}

/**
 * 招聘启动岗位导出
 */
export function hrmRecruitStartPositionExportAPI(data) {
  return request({
    url: 'hrmRecruitStartPosition/exportRecruitStartPosition',
    method: 'post',
    data: data,
    responseType: 'blob',
    headers: {
      'Content-Type': 'application/json;charset=UTF-8'
    }
  })
}

/**
 * 招聘启动岗位导入模板
 */
export function startPositionImportTemplateAPI() {
  return request({
    url: 'hrmRecruitStartPosition/downloadExcel',
    method: 'post',
    responseType: 'blob'
  })
}

/**
 * 招聘启动岗位Excel导入
 */
export function startPositionExcelImportAPI(data) {
  const formData = new FormData()
  formData.append('file', data.file)
  return request({
    url: 'hrmRecruitStartPosition/excelImport',
    method: 'post',
    data: formData,
    headers: {
      'Content-Type': 'multipart/form-data'
    }
  })
}

/**
 * 上报招聘启动岗位
 */
export function hrmRecruitStartPositionReportAPI() {
  return request({
    url: 'hrmRecruitPlan/syncStartPosition',
    method: 'post'
  })
}
